/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package etherblocks.game.entitysystem.systems;

import com.jme3.scene.Node;
import etherblocks.engine.objects.ModelObject;
import etherblocks.game.entitysystem.*;

/**
 *
 * @author Carl
 */
public class ModelObjectSystem implements EntitySystem{

    public ModelObjectSystem(Node rootNode){
        this.rootNode = rootNode;
    }
    protected Node rootNode;
    
    @Override
    public void onNextFrameCalculation(EntityMap entityMap, float lastTimePerFrame){
        
    }
    
    protected ModelObject getModelObject(Entity entity){
        return getModelObject(rootNode, entity.getID());
    }
    
    public static ModelObject getModelObject(Node rootNode, int entityID){
        return (ModelObject) rootNode.getChild(getModelObjectName(entityID));
    }
    
    protected static String getModelObjectName(int entityID){
        return ("entity_" + entityID);
    }
}
